﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows.Media.Imaging;

namespace CirqueDuCsDemo
{
    class NextImage
    {
        private const int _totalImages = 10;
        private const string _directory = @"Resources\";
        private const string _extension = ".jpg";

        private int _numImage = 0;

        public NextImage()
        {
        }

        public Image GetNextImage()
        {
            String imageName = GetNextImageName();
            Uri uri = new Uri(imageName, UriKind.Relative);
            BitmapImage src = new BitmapImage(uri);
            Image image = new Image();
            image.Source = src;
            _numImage++;
            return image;
        }

        string GetNextImageName()
        {
            Int32 imageId = (_numImage % _totalImages);
            return _directory + imageId.ToString() + _extension;
        }
        
    }
}
